package edu.nf.waimai.dao.order;

import edu.nf.waimai.model.order.Order;
import edu.nf.waimai.model.order.ShopOrder;
import edu.nf.waimai.model.order.UserOrder;
import edu.nf.waimai.model.shop.Shop;

import java.util.List;

/**
 * @Date 2023/6/26
 * @Author zgm
 */
public interface OrderDAO {
    /**
     * 根据用户id查询订单
     * @param uid
     * @return
     */
    List<UserOrder> listOrder(Integer uid, String orderType);

    /**
     * 根据商家id和状态查询订单
     * @param shopId
     * @param orderStatus
     * @return
     */
    List<ShopOrder> listShopOrder(Integer shopId, Integer orderStatus);
    /**
     * 根据商家id和状态查询骑手已接单的订单
     * @param shopId
     * @param orderStatus
     * @return
     */
    List<ShopOrder> listShopIsRiderOrder(Integer shopId, Integer orderStatus);
    /**
     * 根据订单id修改状态
     * @param orderId
     * @return
     */
    int updateOrder(String orderId, Integer status);

    /**
     * add订单
     * @param order
     * @return
     */
    int addOrder(Order order);

    /**
     * 根据用户id查询时间最新的订单
     * @param uid
     * @return
     */
    UserOrder getUserOrder(Integer uid);

    UserOrder getShopOrder(String orderId);

}
